package com.tekj.cxqcb.view.Module.adapter;

import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.squareup.picasso.Picasso;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.operation.resultBean.ApiShopServiceSelectAllBean;

import java.util.List;

import common.tool.Tools;

public class StoreManagementAdapter extends BaseQuickAdapter<ApiShopServiceSelectAllBean.DataBean.ListBean, BaseViewHolder> {

    public StoreManagementAdapter(@Nullable List<ApiShopServiceSelectAllBean.DataBean.ListBean> data) {
        super(R.layout.item_store_management, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ApiShopServiceSelectAllBean.DataBean.ListBean item) {
        Picasso.get().load(item.getServiceImg().replace(",",""))
                .resize(1920, 1080)
                .centerCrop()
                .onlyScaleDown()
                .into((ImageView) helper.getView(R.id.img_photo));

        helper.setText(R.id.tv_store_name, item.getServiceName());
        helper.setText(R.id.tv_Price, item.getPrice());
        helper.setText(R.id.tv_Original_price, item.getMarketPrice());
        TextView textView = helper.getView(R.id.tv_Original_price);
        textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
    }
}
